﻿
Partial Class uc_project
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            FillSupportingData()
        End If
    End Sub

    Private Sub FillSupportingData()
        Dim _bl As New scrumrBL

        _bl.FillScrumMastersList(ddlScrumMasters)
        _bl.FillProjectOwnersList(ddlProjectOwners)

        _bl = Nothing
    End Sub

    Protected Sub bSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bSave.Click
        Dim _p As New project
        lOutcome.Visible = True

        Try
            _p.AddProject(tProjectName.Text, tProjectDesc.Text, ddlScrumMasters.SelectedValue, ddlProjectOwners.SelectedValue)
            lOutcome.Text = String.Format("Project {0} created!", _p.ProjectId)
            bSave.Visible = "False"
            bNewProject.Visible = "True"
        Catch ex As Exception
            lOutcome.Text = ex.Message
        End Try

    End Sub

    Protected Sub bNewProject_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bNewProject.Click
        Response.Redirect("ProjectMaintenance.aspx")
    End Sub

End Class
